home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1999 March / EnigmA AMIGA RUN 35 (1999)(G.R. Edizioni)(IT)[!][issue 1999-03].iso / earcd / -archivi / -recent1 / nsm_transpose.lha / transpose / transposeup.c < prev    next >
C/C++ Source or Header  |  1998-12-13  |  1KB  |  55 lines

  1. /*
  2.     Transpose up the range one note. If no
  3.     range is specified, the current track
  4.     will be transposed.
  5.  
  6.     Made by Kjetil S. Matheussen 13.12.98.
  7.  
  8.     This is an example on how to make an
  9.     octamed plug-in with the nsm-system.
  10.  
  11.     e-mail: kjetilma@ifi.uio.no
  12.  
  13.     Address:
  14.     Kjetil S. Matheussen
  15.     5423 Sogn Studentby
  16.     0858 Oslo
  17.     Norway
  18. */
  19.  
  20. #include "/nsm.h"
  21.  
  22. void main(){
  23.     OCTABASE ob;
  24.     BLOCKBASE bb;
  25.  
  26.     UWORD starttrack,endtrack;
  27.     UWORD    startline,endline;
  28.  
  29.     UWORD line,track;
  30.  
  31.     if((ob=getoctabase())==0) goto exit;            /* Allways include this line first in
  32.                                                                     your plug-ins. */
  33.     bb=getcurrblockbase(ob);
  34.  
  35.     if(isranged(ob)){
  36.         starttrack=getrangestarttrack(ob);
  37.         endtrack=getrangeendtrack(ob);
  38.         startline=getrangestartline(ob);
  39.         endline=getrangeendline(ob);
  40.     }else{
  41.         starttrack=getcurrtrack(ob);
  42.         endtrack=starttrack;
  43.         startline=0;
  44.         endline=getnumlines(bb)-1;
  45.     }
  46.  
  47.     for(line=startline;line<=endline;line++)
  48.         for(track=starttrack;track<=endtrack;track++)
  49.             if(getnote(bb,track,line)) setnote(bb,track,line,getnote(bb,track,line)+1);
  50.  
  51.     updateeditor(ob);
  52.  
  53. exit:
  54. }
  55.